package com.sm.dao;

import com.sm.model.Dynamic;
import com.sm.model.DynamicComment;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DynamicCommentMapper {

    //添加一条评论记录
    int commentDynamic(DynamicComment dynamicComment);

    //    01根据动态id查询的所有一级评论回复数据
    List<DynamicComment> selectCommentByDynamicFirst(@Param("dynamicId") Integer dynamicId);

    //02根据动态id查询的所有二级评论回复数据
    List<DynamicComment> selectCommentByDynamicSecond(@Param("dynamicId") Integer dynamicId, @Param("fatherCommentId") Integer fatherCommentId);

    void deleteCommentByDynamic(@Param("dynamicId") Integer dynamicId);

    int selectUserNumber(@Param("dynamicId")Integer dynamicId);

    int selectCommentNum(@Param("dynamicId")Integer dynamicId);

    List<DynamicComment> selectFirstDynamicById(@Param("dynamicId") Integer dynamicId);

    List<DynamicComment> selectSecondComments(@Param("dynamicId")Integer dynamicId,@Param("fatherId")Integer fatherId,@Param("topId")Integer topId);

    DynamicComment selectByPrimaryKey(@Param("commentId")Integer commentId);
}
